<template>
  <a-modal
    v-model="vertifyVisible"
    title="用户验证"
    ok-text="确定"
    cancel-text="取消"
    width="576px"
    :maskClosable="false"
    @ok="submitPassword"
    class="dict-list-model"
    :bodyStyle="{
      height: 400 + 'px',
      'overflow-y': 'auto',
      'overflow-x': 'hidden',
    }"
  >
    <a-form-model
      class="user-info-form"
      :model="verifyForm"
      ref="verifyFormRef"
      :rules="verdifyRules"
    >
      <a-form-model-item label="密码" prop="password">
        <a-input v-model="addDrugItem.drugName"></a-input>
      </a-form-model-item>
    </a-form-model>
  </a-modal>
</template>

<script>
import rulesData from "@/utils/rules";
import api from "@/api/login";

export default {
  name: "VerifyView",
  prop: ['isPassVertify','vertifyVisible'],
  data() {
    return {
      verifyForm: {
        password: "",
      },
      rules: {
        password: [
          rulesData.required("请输入密码"),
          rulesData.whitespace("请输入密码"),
        ],
      },
    };
  },
  methods: {
    // 登录
    submitPassword() {
      this.$refs.verifyFormRef.validate((valid) => {
        if (valid) {
          let params = {
            ...this.vertifyForm,
            userName: localStorage.getItem("userName"),
          };
          api.login(params).then((res) => {
            if (res.status == 200) {
              this.isPassVertify = true;
            }
          });
        }
      });
    },
  },
  beforeCreate() {},
};
</script>

<style lang="less" scoped>
/deep/div .ant-page-header .ant-page-header-ghost {
  height: 0 !important;
  padding: 0 !important;
  display: none !important;
}
.login-group {
  background-color: #ffffff;
  width: 100%;
  height: 100%;
  min-height: 600px;
  position: relative;
  .code-box {
    position: relative;
    img {
      position: absolute;
      z-index: 1;
      width: 133px;
      right: 5px;
      height: 34px;
      top: 3px;
    }
    input {
      padding-right: 120px;
    }
  }
  .left-box {
    position: absolute;
    width: 576px;
    height: 100%;
    background: linear-gradient(to bottom, #707de0, #3d47be);
    .left-bg-img {
      width: 576px;
      height: 100%;
      background-size: 576px 900px;
    }
  }

  .right-box {
    position: absolute;
    right: 0;
    top: 0;
    width: calc(~"100% - 576px");
    height: 100%;
    .form-box {
      position: absolute;
      left: 50%;
      top: 50%;
      margin-left: -261px;
      margin-top: -241px;
      width: 432px;
      min-height: 482px;
      background: #ffffff;
      border: 1px solid rgba(227, 230, 235, 1);
      box-shadow: 0px 0px 26px 0px rgba(10, 31, 68, 0.08);
      border-radius: 8px;
      padding: 36px 40px;

      .login-form-button {
        height: 40px;
        width: 100%;
        font-size: 16px;
        line-height: 40px;
        color: #ffffff;
        text-align: center;
        font-weight: 400;
        margin-top: 16px;
      }
      .tit {
        margin-bottom: 24px;
        font-size: 32px;
        line-height: 32px;
        color: #1b1e22;
        letter-spacing: 0;
        font-weight: 500;
      }
      .error-tip {
        display: none;
        box-sizing: border-box;
        padding-left: 14px;
        height: 40px;
        background: #fff6f5;
        border: 1px solid rgba(250, 95, 95, 1);
        border-radius: 4px;
        font-size: 14px;
        line-height: 40px;
        color: #fa5f5f;
        text-align: left;
        font-weight: 400;
        margin-bottom: 16px;
        .show {
          display: block;
        }
        span {
          font-size: 20px;
          position: relative;
          top: 4px;
          margin-right: 8px;
        }
      }
      .tip {
        margin: 0;
        text-align: center;
        font-size: 14px;
        color: rgba(27, 30, 34, 0.65);
        letter-spacing: 0;
        line-height: 20px;
        font-weight: 400;
        a {
          color: #4487f7;
        }
      }
    }
  }
}
input {
  height: 40px;
}
/deep/.ant-input-affix-wrapper .ant-input:not(:last-child) {
  height: 40px;
}
/deep/.ant-form-item {
  margin-bottom: 16px;
}
/deep/.ant-form-item-label {
  line-height: 20px;
  margin-bottom: 7px;
}
/deep/.ant-form-item-required:before {
  display: none;
}
/deep/.ant-form-item-required:after {
  display: inline-block;
  margin-right: 4px;
  color: #f5222d;
  font-size: 14px;
  font-family: SimSun, sans-serif;
  line-height: 1;
  content: "*";
}
/deep/.ant-form-explain {
  margin-top: 4px;
}
</style>
